<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="avatar" label="管理员头像" width="180" align="center">
      <template #default="scope">
        <img :src="scope.row.avatar" alt="" />
      </template>
    </el-table-column>
    <el-table-column prop="createdAt" label="创建时间" width="180" align="center" />
    <el-table-column label="操作" align="center">
      <template #default="scope">
        <el-button size="small" @click="handleEdit(scope.row)"> 编辑 </el-button>
        <el-button size="small" type="danger" @click="handleDelete(scope.row)"> 删除 </el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
import { ref } from 'vue'
import { adminList } from '@/api/user'
let tableData = ref([])
async function loadList() {
  let r = await adminList()
  tableData.value = r.data
  console.log(r.data)
}
loadList()
</script>

<style></style>
